class Solution {
public:
    void deal(vector<vector<int>>& matrix,int row,int col){
        //列变成0
        for(int i=0;i<matrix.size();++i)matrix[i][col]=0;
        //行变成0
        for(int j=0;j<matrix[row].size();++j)matrix[row][j]=0;
    }
    void setZeroes(vector<vector<int>>& matrix) {
        vector<pair<int,int>>store;
        for(int i=0;i<matrix.size();++i){
            for(int j=0;j<matrix[i].size();++j){
                if(matrix[i][j]==0)
                store.push_back({i,j});
            }
        } 

        //处理数组
        for(auto [a,b]:store){
            deal(matrix,a,b);
        }

        // return matrix;
    }
};